package com.w2cx.selenium.page;

import com.sun.org.apache.regexp.internal.RE;
import com.w2cx.selenium.base.DriverBase;
import com.w2cx.selenium.util.Locator;
import org.openqa.selenium.WebElement;

import java.util.List;

public class OperatePositionManagePage extends BasePage {

    public OperatePositionManagePage(DriverBase driver){
        super(driver);
    }

    //获取运营管理菜单
    public WebElement getOperateManageMenu(){
        //return this.getOperateManageMenu();
        List<WebElement> list = elements(Locator.getByLocator("firstMenuList"));
        WebElement element = list.get(5);
        System.out.println("找到元素:"+element.getText());
        return element;
    }


    //获取“配置运营位”菜单
    public WebElement getOperatePositionManageMenu(){
        WebElement element = element(Locator.getByLocator("operatePositionManageMenu"));
        return element;
    }


    //获取第一条“内容管理”
    public WebElement getFirstContentManageBtn(){
        WebElement element = element(Locator.getByLocator("firstContentManage"));
        return element;
    }

    //获取“添加”按钮
    public WebElement getAddBtn(){
        return  element(Locator.getByLocator("posiManageAddBtn"));
    }

    //获取标题输入框
    public WebElement getTitleInput(){
        return element(Locator.getByLocator("titleInput"));
    }

    //获取链接目标下拉框
    public WebElement getLinkTargetDownList(){
        return element(Locator.getByLocator("linkTargetDownList"));
    }

    //获取链接目标选项
    public WebElement getLinkTargetOption(){
        return element(Locator.getByLocator("selectLinkTargetOption"));
    }

    //获取确定按钮
    public WebElement getAddConfirmBtn(){
        return element(Locator.getByLocator("addPosiConfirmBtn"));
    }

    //获取第一条title
    public WebElement getFirstTitle(){
        return element(Locator.getByLocator("firstPosiTitle"));
    }


    //获取第一条删除按钮
    public WebElement getFirstDelBtn(){
        return element(Locator.getByLocator("firstPosiDelBtn"));
    }

    //删除--确定按钮
    public WebElement getDelConfirmBtn(){
        return element(Locator.getByLocator("delPosiConfirmBtn"));
    }
}
